/*
 *    Copyright (c) 2018-2025, bfcloud All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: bfcloud
 */

import request from '@/router/axios'

export function getRenwufaqiPage(query) {
  return request({
    url: '/appr-contract/zdrwfaqi/page',
    method: 'get',
    params: query
  })
}
export function getWenbenHzList(query) {
  return request({
    url: '/appr-contract/zdrwwbhz/getPageForWb',
    method: 'get',
    params: query
  })
}

export function getTreeData(query) {
  return request({
    url: '/appr-contract/zdrwfaqi/getTreeData',
    method: 'get',
    params: query
  })
}

export function updateRenwuDetailStatus(query) {
  return request({
    url: '/appr-contract/zdrwwbhz/updateRenwuDetailStatus',
    method: 'post',
    data: query
  })
}
export function saveRenwuFaQi(query) {
  return request({
    url: '/appr-contract/zdrwfaqi/saveRenwufaqi',
    method: 'post',
    data: query
  })
}

export function getRenwuzhibiaokuList(query) {
  return request({
    url: '/appr-contract/zdrwfaqi/getRenwuzhibiaokuList',
    method: 'get',
    params: query
  })
}
// 发约人组织结构
export function fayuetree(query) {
  return request({
    url: '/appr-contract/hetonghtcj/fayuetree',
    method: 'get',
    params: query
  })
}


export function selecthtgzById(id) {
  return request({
    url: '/appr-contract/hetonghtcj/selecthtgzById/' + id,
    method: 'get'
  })
}
export function getNodeInfo(id) {
  return request({
    url: '/appr-contract/zdrwfaqi/getNodeInfo/' + id,
    method: 'get'
  })
}
export function getNodeInforws(id) {
  return request({
    url: '/appr-contract/workassigncj/getNodeInfo/' + id,
    method: 'get'
  })
}
export function getObj(id) {
  return request({
    url: '/appr-contract/zdrwcj/' + id,
    method: 'get'
  })
}

export function saveZdrwRenwufaqiDetailForPlus(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/saveZdrwRenwufaqiDetailForPlus',
    method: 'post',
    data: query
  })
}
// 校验被审核人是否重复
export function isExistRw(query) {
  return request({
    url: '/appr-contract/zdrwcj/isExistRw',
    method: 'post',
    data: query
  })
}
// 任务拟定结束
export function ndendTask(query) {
  return request({
    url: '/appr-contract/zdrwnd/endTask',
    method: 'post',
    data: query
  })
}
export function endTask(query) {
  return request({
    url: '/appr-contract/zdrwcj/endTask',
    method: 'post',
    data: query
  })
}
export function saveZdrwRenwufaqiDetailForAdd(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/saveZdrwRenwufaqiDetailForAdd',
    method: 'post',
    data: query
  })
}

export function updateOrSaveDetail(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/updateOrSaveDetail',
    method: 'post',
    data: query
  })
}

export function getRenwuZhibiaoPage(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/page1',
    method: 'get',
    params: query
  })
}

export function getzhongdianrenwuPage(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqizdrw/page',
    method: 'get',
    params: query
  })
}

export function getRenwuShenhePage(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqizdrw/getRenwuShenhePage',
    method: 'get',
    params: query
  })
}

export function getWenbenHuizongPage(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqizdrw/getWenbenHuizongPage',
    method: 'get',
    params: query
  })
}
export function delzdrwrenwufaqidetail(id) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/' + id,
    method: 'delete'
  })
}

export function getDetailList(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/getDetailList',
    method: 'get',
    params: query
  })
}
export function getDetailListByZdrwNdId(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/getDetailListByZdrwNdId',
    method: 'get',
    params: query
  })
}
export function getDetailListdepid(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/getDetailListdepid',
    method: 'get',
    params: query
  })
}
// 最总得分列表
export function zzdfList(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/getDetailListForCk',
    method: 'get',
    params: query
  })
}
// 任务拟定详情列表
export function getDetailListnd(query) {
  return request({
    url: '/appr-contract/zdrwnd/getDetailList',
    method: 'get',
    params: query
  })
}
export function tuisongchuangjian(query) {
  return request({
    url: '/appr-contract/zdrwfaqi/tuisongchuangjian',
    method: 'get',
    params: query
  })
}
// 任务拟定提交
export function submitStatusAllrwnd(query) {
  return request({
    url: '/appr-contract/zdrwnd/submitStatusAll',
    method: 'post',
    data: query
  })
}
export function renwuxiada(query) {
  return request({
    url: '/appr-contract/zdrwfaqi/renwuxiada',
    method: 'get',
    params: query
  })
}
export function renwuxiadaByIds(query) {
  return request({
    url: '/appr-contract/zdrwfaqi/renwuxiadaByIds',
    method: 'post',
    data: query
  })
}


export function deleteBatchcj(query) {
  return request({
    url: '/appr-contract/zdrwcj/deleteBatch',
    method: 'get',
    params: query
  })
}
export function getzdrwcjpage(query) {
  return request({
    url: '/appr-contract/zdrwcj/page',
    method: 'get',
    params: query
  })
}
// 任务拟定列表
export function renwuNdList(query) {
  return request({
    url: '/appr-contract/zdrwnd/page',
    method: 'get',
    params: query
  })
}
export function getzdrwpage(query) {
  return request({
    url: '/appr-contract/zdrwsh/pageByrwsh',
    method: 'get',
    params: query
  })
}
export function tijiao(id) {
  return request({
    url: '/appr-contract/zdrwcj/tijiao/' + id,
    method: 'get'
  })
}

export function okAllApi(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqizdrw/okAll',
    method: 'post',
    data: query
  })
}
//任务审核 ----批量通过
export function okAllBatchBykhr(query) {
  return request({
    url: '/appr-contract/zdrwsh/okAllBatchBykhr',
    method: 'post',
    data: query
  })
}
//拟定审核 ----批量通过
export function okAllBatchByndsh(query) {
  return request({
    url: '/appr-contract/zdrwsh/okAllBatchByndsh',
    method: 'post',
    data: query
  })
}
//任务审核 ----批量驳回
export function backAllBatchBykhr(query) {
  return request({
    url: '/appr-contract/zdrwsh/backAllBatchBykhr',
    method: 'post',
    data: query
  })
}
//拟定审核 ----批量驳回
export function backAllBatchByndsh(query) {
  return request({
    url: '/appr-contract/zdrwsh/backAllBatchByndsh',
    method: 'post',
    data: query
  })
}
export function okAllzb(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/okAll',
    method: 'post',
    data: query
  })
}
export function backAllzb(query) {
  return request({

    url: '/appr-contract/zdrwrenwufaqidetail/backAll',
    method: 'post',
    data: query
  })
}
export function wenbenXiada(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqizdrw/wenbenXiada',
    method: 'post',
    data: query
  })
}



// 批量删除
export function deleteBatchRwfq(query) {
  return request({
    url: '/appr-contract/zdrwfaqi/deleteBatch',
    method: 'get',
    params: query
  })
}
export function Renwundts(query) {
  return request({
    url: '/appr-contract/zdrwfaqi/renwudts',
    method: 'get',
    params: query
  })
}
export function RenwundtsByIds(query) {
  return request({
    url: '/appr-contract/zdrwfaqi/RenwundtsByIds',
    method: 'post',
    data: query
  })
}
// 获取指标拟定部分
export function getNiDingList(query) {
  return request({
    url: '/appr-contract/zdrwfaqi/getNiDingList',
    method: 'get',
    params: query
  })
}
//指标导出
export function jgtbExportExcel(query) {
  return request({
    url: '/appr-contract/zdrwfaqi/jgtbExportExcel',
    method: 'post',
    data: query,
    responseType: 'blob'
  })
}
//指标审核
export function setwbsh(id, wbsh) {
  return request({
    url: '/appr-contract/zdrwfaqi/wenbenshenhe/' + id + '/' + wbsh,
    method: 'get'
  })
}

export function getZhibiaoCheckdData(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/getZhibiaoCheckdData',
    method: 'get',
    params: query
  })
}
//文本汇总批量审核通过
export function okAllBatch(query) {
  return request({
    url: '/appr-contract/zdrwwbhz/okAllBatch',
    method: 'post',
    data: query
  })
}
//文本汇总批量审核驳回
export function backAllBatch(query) {
  return request({
    url: '/appr-contract/zdrwwbhz/backAllBatch',
    method: 'post',
    data: query
  })
}
// 详情删除任务
export function removeDetailById(id) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/removeDetailById/' + id,
    method: 'get',
  })
}
// 详情任务编辑
export function updateDetailById(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/updateDetailById',
    method: 'post',
    data: query
  })
}
// 详情添加任务
export function addDetail(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/addDetail',
    method: 'post',
    data: query
  })
}
// 详情添加任务 /zdrwnd/saveDetail
export function addDetailByNd(query) {
  return request({
    url: '/appr-contract/zdrwnd/saveDetail',
    method: 'post',
    data: query
  })
}
// 拟定新增明细 zdrwnd/addDetail
export function addDetailnd(query) {
  return request({
    url: '/appr-contract/zdrwnd/addDetail',
    method: 'post',
    data: query
  })
}
export function getZhibiaoData(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/getZhibiaoData',
    method: 'get',
    params: query
  })
}

//指标拟定汇总
export function getZhibiaoCheckndData(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/getZhibiaoCheckndData',
    method: 'get',
    params: query
  })
}
export function saveZhibiaoData(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/getZhibiaoCheckndData',
    method: 'get',
    params: query
  })
}
export function submitStatusAll(query) {
  return request({
    url: '/appr-contract/zdrwcj/submitStatusAll',
    method: 'post',
    data: query
  })
}

export function getPage(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/getPage',
    method: 'get',
    params: query
  })
}

//获取权重
export function getSumWeight(query) {
  return request({
    url: '/appr-contract/zdrwfaqi/getSumWeight',
    method: 'get',
    params: query
  })
}

// 推送文本审核批量
export function tuisongwenbenByIds(query) {
  return request({
    url: '/appr-contract/zdrwfaqi/tuisongwenbenByIds',
    method: 'post',
    data: query
  })
}
// 推送文本审核
export function tuisongwenben(id) {
  return request({
    url: '/appr-contract/zdrwfaqi/tuisongwenben/' + id,
    method: 'get'
  })
}

//批量删除
export function deleteBatch(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/deleteBatch',
    method: 'get',
    params: query
  })
}
//判断该合同下是否有指标驳回
export function confirmStatus(ids) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/confirmStatus/' + ids,
    method: 'get'
  })
}

//合同审核-批量同意或驳回
export function sethtshStatus(ids, wbsh) {
  return request({
    url: '/appr-contract/zdrwfaqi/sethtshStatus/' + ids + '/' + wbsh,
    method: 'get'
  })
}
// /zdrwsh/backAll
export function rejected(query) {
  return request({
    url: '/appr-contract/zdrwsh/backAll',
    method: 'post',
    data: query
  })
}

// 任务发起修改
export function updateForFaqi(query) {
  return request({
    url: '/appr-contract/zdrwfaqi/updateForFaqi',
    method: 'post',
    data: query
  })
}

export function pageByndsh(query) {
  return request({
    url: '/appr-contract/zdrwsh/pageByndsh',
    method: 'get',
    params: query
  })
}
export function getLlrList(query) {
  return request({
    url: '/appr-contract/zdrwcj/getLlrList',
    method: 'get',
    params: query
  })
}

export function getPageForrwnd(query) {
  return request({
    url: '/appr-contract/zdrwcj/getPageForrwnd',
    method: 'get',
    params: query
  })
}

export function copyRwDetails(query) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/copyRwDetails',
    method: 'get',
    params: query
  })
}
// 任务发起和任务拟定新增判断被考核人是否重复
export function isExistData(query) {
  return request({
    url: '/appr-contract/zdrwfaqi/isExistData',
    method: 'get',
    params: query
  })
}

// 任务拟定编辑添加保存判断批次
export function checkIsOne(id) {
  return request({
      url: '/appr-contract/zdrwnd/checkAdd/'+id,
      method: 'get',
  })
}
export function pageByTsRwDetail(query) {
  return request({
    url: '/appr-contract/zdrwnd/pageByTsRwDetail',
    method: 'get',
    params: query
  })
}

export function tsRwDetailToRw(obj) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/tsRwDetailToRw',
    method: 'post',
    data: obj
  })
}
// 任务发起编辑保存
export function saveDetailForCj(obj) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/saveDetailForCj',
    method: 'post',
    data: obj
  })
}
export function rwDetailisflag(obj) {
  return request({
    url: '/appr-contract/zdrwrenwufaqidetail/rwDetailisflag',
    method: 'post',
    data: obj
  })
}
export function getRwPlFaqiCount(obj) {
  return request({
    url: '/appr-contract/zdrwcj/getRwPlFaqiCount',
    method: 'post',
    data: obj
  })
}
//推送考核委员会审定
export function tuisongshending(query) {
  return request({
    url: '/appr-contract/zdrwfaqi/tuisongshending',
    method: 'post',
    data: query
  })
}
export function exportWord() {
  return request({
    url: '/appr-contract/zdrwcj/exportWord',
    method: 'post',
    responseType: 'blob'
  })
}
